/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.me.mobisegua;

import android.app.Activity;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import org.me.mobisegua.adapter.DBBuilder;
import org.me.mobisegua.adapter.MobiSegUAAdapter;

/**
 *
 * @author Zé Carlos
 */
public class MobiSegUA extends Activity
{

    DBBuilder builder;
    MobiSegUAAdapter db;
    
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle)
    {
        super.onCreate(icicle);
        // ToDo add your GUI initialization code here

        setContentView(R.layout.main);
        
        db = new MobiSegUAAdapter(this.getApplicationContext());
        db.open();

        /** If Database is empty, fill it with initial values. */
        if (db.getNumAreas() == 0)
        {
            builder = new DBBuilder(db);
            builder.fillDB();
        }

        Button startButton = (Button) findViewById(R.id.startBtn);
        startButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view)
            {
                /** Start an new activity. */
                Intent i = new Intent(MobiSegUA.this , MapViewActivity.class);
                MobiSegUA.this.startActivity(i);
            }
        });

    }

        
}

